﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace TodoApp.Migrations
{
    public partial class Added_TodoGoodsOrdes : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<Guid>(
                name: "LiveShopGoodsID",
                table: "TodoOrdes",
                type: "uniqueidentifier",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.CreateTable(
                name: "TodoGoodsOrdes",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrdersNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrdersSum = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    OrdersDateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    TodostatusID = table.Column<int>(type: "int", nullable: false),
                    LiveShopUsersID = table.Column<int>(type: "int", nullable: false),
                    LiveShopAddressID = table.Column<int>(type: "int", nullable: false),
                    LiveShopGoodsID = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TodoGoodsOrdes", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "TodoGoodsOrdes");

            migrationBuilder.AlterColumn<int>(
                name: "LiveShopGoodsID",
                table: "TodoOrdes",
                type: "int",
                nullable: false,
                oldClrType: typeof(Guid),
                oldType: "uniqueidentifier");
        }
    }
}
